package com.windy.app;

import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.remoting.exception.RemotingException;

public class MQTest {
    public static void main(String[] args) throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("testGroup1");
        producer.setNamesrvAddr("127.0.0.1:9876");
        producer.start();
        Message message = new Message("testTopic1","testTag1","发送消息1".getBytes());
        SendResult result = producer.send(message);
    }
}
